package task13;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/13 8:39
 * @description:三角形：继承抽象类
 */
public class Triangle extends Shape{
  double a;
  double h;

  public Triangle() {
  }

  public Triangle(double a, double h) {
    this.a = a;
    this.h = h;
  }

  @Override
  public double area() {
    return a*h/2;
  }

  @Override
  public String getName() {
    return "三角形";
  }

  /*@Override
  public void output() {
    System.out.println(getName()+"的面积是："+area());
  }*/
}
